
    import React from 'react'
    import Modal from './Modal'

    class ShowModal extends React.Component{

        state = {
            isVisible: false,
        }
        //显示状态狂
        handleClick=()=>{
            this.setState({isVisible:true})
        }
        //点击模态框中确定按钮的回调
        handleOk=()=>{
            this.setState({
                isVisible:false,
            })
        }
        //点击模态框中取消按钮的回调
        handleCancel=()=>{
            this.setState({
                isVisible:false,
            })
        }

             render(){
                return(
                 <fieldset>
                     <legend>显示模态框</legend>
                     <Modal title="<h1>充值提示</h1>" visible={this.state.isVisible}
                      onOk = {this.handleOk}
                       onCancel = {this.handleCancel}>
                        <h2>充值:88888888888</h2>
                       </Modal>
                     {/* 点击事件 */}
                     <button onClick= {this.handleClick}>点击显示</button>
                </fieldset>
            )
        }      
    }
    export default ShowModal